/*
Copyright 2010,2011 Matt Van Der Westhuizen

This file is part of CGLL.

CGLL is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

CGLL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with CGLL.  If not, see <http://www.gnu.org/licenses/>.
*/

package org.chaoticengine.cgll.collision;

import java.util.List;
import org.chaoticengine.cgll.entity.Entity;

/**
 *
 * @author Matt v.d. Westhuizen
 */
public interface IBroadPhaseCollisionDetector {
    /**
     * Adds an entity to the broad-phase hit-detector. Entities will be added
     * every iteration, as I suspect it won't be any cheaper to update the
     * entity position than to just clear and recalculate all entities.
     *
     * @param entity Entity to add.
     */
    public void addEntity(Entity entity);

    /**
     * Adds list of entities to the broad-phase hit-detector. Entities will be
     * added every iteration, as I suspect it won't be any cheaper to update the
     * entity position than to just clear and recalculate all entities.
     *
     * @param entity List of Entities to add.
     */
    public void addEntities(List<Entity> entities);

    /**
     * Removes a specific entity from the broad phase collision detector.
     * @param e
     */
    public void removeEntity(Entity e);

    /**
     * Updates the broad-phase hit detector if necessary and then uses the
     * narrow phase hit detector to check for collisions between any
     * collision candidates detected during the broad phase.
     */
    public void doHitDetection();

    public void setNarrowPhaseHitDetector(INarrowPhaseCollisionDetector npHd);

    public INarrowPhaseCollisionDetector getNarrowPhaseHitDetector();
}
